import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Home from './pages/home'
import Index from './pages/index'

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          component: Index
        },
        {
          path: '/product',
          name: 'productList',
          component: () => import('./pages/productList.vue')
        },
        {
          path: '/model',
          name: 'model',
          component: () => import('./pages/model.vue')
        },
        {
          path: '/productDetail/:id',
          name: 'productDetail',
          component: () => import('./pages/productDetail.vue')
        },
        {
          path: '/news',
          name: 'news',
          component: () => import('./pages/news.vue')
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('./pages/about.vue')
        },
        {
          path: '/detail/:id',
          name: 'detail',
          component: () => import('./pages/detail.vue')
        },
        {
          path: '/comment',
          name: 'comment',
          component: () => import('./pages/comment.vue')
        }
      ]
    }
  ]
})